<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title></title>
    <link rel="stylesheet" href="{$Assets}layui/css/layui.css">
    <style type="text/css">
        .layui-input-block{
            margin-right: 50px;   
        }
    </style>
</head>
<body>

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>更新订单</legend>
</fieldset>

<form class="layui-form" action="">

  <input type="hidden" name="id" value='{$info.id}'>

  <div class="layui-form-item">
    <label class="layui-form-label">订单号</label>
    <div class="layui-input-inline" style="width: 250px;">
      <input type="text" value="{$info.orderid}" lay-verify="required" placeholder=" autocomplete="off" class="layui-input" readonly="readonly" style="border-width: 0px;">
    </div>
    
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">消费者</label>
    <div class="layui-input-inline">
      {if condition="$info.head != ''"}
      <img src="{$info.head}" height="38" width="38" style="float: left;margin-right: 10px;">
      {/if}
      <input type="text" value="{$info.username}" lay-verify="required" placeholder=" autocomplete="off" class="layui-input" readonly="readonly" style="float: left;width: auto;border-width: 0px;padding-left: 0px;">
    </div>
  </div>



  <div class="layui-form-item">
    <label class="layui-form-label">商品</label>
    <div class="layui-input-block">
      <input type="text"  value="{$info.shoptitle}" readonly="readonly" lay-verify="required" autocomplete="off" placeholder="" class="layui-input" style="border-width: 0px;">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">类型</label>
    <div class="layui-input-inline" style="width:150px;">
      <input type="text" value="{$info.type}" lay-verify="required" placeholder="" autocomplete="off" class="layui-input" readonly="readonly" style="border-width: 0px;">
    </div>
  </div>


  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">状态</label>
      <div class="layui-input-inline" style="width:150px;">
        <select name="state">
          <option value="">请选择</option>
          <option value="0" {if condition="$info.state == 0"} selected="" {/if}>已使用</option>
          <option value="1" {if condition="$info.state == 1"} selected="" {/if}>未使用</option>
          <option value="p0" {if condition="$info.state == p0"} selected="" {/if}>未付款</option>
        </select>
      </div>
    </div>
  </div>







    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="addshop">提交</button>
        </div>
    </div>

</form>



<script src="{$Assets}layui/layui.js?t=1515376178709"></script>
<script>
    layui.use(['form', 'layedit', 'laydate','upload'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,upload = layui.upload
            ,layedit = layui.layedit
            ,laydate = layui.laydate
            ,$ = layui.jquery;

        //
        laydate.render({
            elem: '#date'
        });
        laydate.render({
            elem: '#date1'
        });

        //

        layedit.set({
          uploadImage: {
            url: 'editimg' 
            ,type: 'post' 
          }
        });
        var index = layedit.build('LAY_demo2');

        //
        form.verify({
            
        });

          //
        form.on('submit(addshop)', function(data){

          var datas=JSON.stringify(data.field);
          
          var iframe = parent.layer.getFrameIndex(window.name);

          

                  $.ajax({
                        type:"POST",
                        url: "{:url('order/editordersave')}",
                        data:{data:datas},
                        dataType:"text",

                        success:function(ret_datas){
                            if(ret_datas==1){
                                layer.msg('更新成功!');
                                setTimeout(function(){
                                  parent.layer.close(iframe);
                                  parent.location.reload();
                                },"1000");
                            }else if(ret_datas==99){
                                layer.msg('修改成功！');
                                setTimeout(function(){
                                  parent.layer.close(iframe);
                                  parent.location.reload();
                                },"1000");
                            }else{
                                layer.msg(ret_datas);
                            }
                            
                           

                        }
                    });

          return false;
        });






    });
</script>
{include file="public/footer"/}
</body>
</html>
